package com.mofang.activity.recommend;

import java.util.ArrayList;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.ProgressBar;

import com.mofang.R;
import com.mofang.activity.BaseTitleViewActiviey;
import com.mofang.activity.MofangCommonUpdateView;
import com.mofang.activity.login.LoginActivity;
import com.mofang.adapters.ScheduleDetailsAdapter;
import com.mofang.utils.ListHeightUtils;
import com.pactera.framework.exception.IException;
import com.pactera.framework.model.MapEntity;

public class ScheduleDetailsActivity extends BaseTitleViewActiviey {

	private ListView schedule_details_list;
	private ScheduleDetailsAdapter adapter;
	private	ArrayList<MapEntity> dataList=new ArrayList<MapEntity>();
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}

	@Override
	protected void initView() {
		setContentView(R.layout.activity_schedule_details);
		setNavigationLeftBtnImage(R.drawable.return_arrow);
		if (getIntent().getStringExtra("CustomerFeedbackTag") != null
				&& getIntent().getStringExtra("CustomerFeedbackTag").equals(
						"CustomerFeedbackTag")) {
			setNavigationTitle("报备客户反馈");
		} else if (getIntent().getStringExtra("AllRecommendedDetailsTag") != null
				&& getIntent().getStringExtra("AllRecommendedDetailsTag")
						.equals("AllRecommendedDetailsTag")) {
			setNavigationTitle("进度详情");
		}
	
		adapter = new ScheduleDetailsAdapter(getApplicationContext(),dataList);
		schedule_details_list = (ListView) findViewById(R.id.schedule_details_list);
		schedule_details_list.setAdapter(adapter);
		ListHeightUtils.setListViewHeightBasedOnChildren(schedule_details_list);

	}
//TODO ViewUpdate
	class ScheduleDetailsUpdateView extends MofangCommonUpdateView<MapEntity>{

		private ProgressDialog progressDialog;
		public ScheduleDetailsUpdateView(Context context) {
			super(context);
			// TODO Auto-generated constructor stub
		}

		@Override
		public void onPreExecute() {
			// TODO Auto-generated method stub
			progressDialog = ProgressDialog.show(mContext, null,
					"Please wait...", true, false);
			super.onPreExecute();
		}
		
		@Override
		public void onPostExecute(MapEntity arg0) {
			// TODO Auto-generated method stub
		}
		@Override
		public void handleException(IException ex) {
			super.handleException(ex);
			viewHelper.showErrorDialog(ex);
		}
		
	}
	
}